<template>
	<view class="all-main">
		<view class="mains">
			<view v-if="data && data.length > 0" class="lists">
				<view v-for="(item,index) in data" :key="index" class="items">
					<view class="list border-bottom">
						<view class="lefts">
							<text>终端SN</text>
						</view>
						<view class="rights">
							<text>{{item.sn}}</text>
						</view>
					</view>
					<view class="list border-bottom">
						<view class="lefts">
							<text>刷卡费率</text>
						</view>
						<view class="rights">
							<text>{{item.creditRate}}</text>
							<text>%</text>
						</view>
					</view>
					<view class="list border-bottom">
						<view class="lefts">
							<text>提交时间</text>
						</view>
						<view class="rights">
							<text>{{item.create_time}}</text>
						</view>
					</view>
					<view class="list border-bottom">
						<view class="lefts">
							<text>状态</text>
						</view>
						<view class="rights">
							<u-tag v-if="item.check_state == 1" text="待审核" type="warning"></u-tag>
							<u-tag v-else-if="item.check_state == 2" text="审核通过" type="success"></u-tag>
							<u-tag v-else text="审核不通过" type="error"></u-tag>
						</view>
					</view>
					<view v-if="item.check_state > 1" class="list border-bottom">
						<view class="lefts">
							<text>审核时间</text>
						</view>
						<view class="rights">
							<text>{{item.check_time}}</text>
						</view>
					</view>
					<view v-if="item.check_state > 1" class="list border-bottom">
						<view class="lefts">
							<text>审核内容</text>
						</view>
						<view class="rights">
							<text>{{item.check_msg}}</text>
						</view>
					</view>
				</view>
			</view>
			<u-empty v-else mode="list" icon="/static/Empty/data_null.png">
			</u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				sn: '',
				data: null
			}
		},
		onLoad(e) {
			this.sn = e.sn
			this.loadData()
		},
		methods: {
			async loadData() {
				uni.showLoading({
					title: '加载中'
				});
				const {
					data: res
				} = await this.$myHttp({
					url: 'v1/getMerchantRateLog',
					data: {
						sn: this.sn
					}
				});
				uni.hideLoading()
				if (res.code == 200) {
					this.data = res.data
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #F2F6FC;
	}
	.all-main {
		.mains {
			.lists {
				padding: 30rpx;
				
				.items {
					background-color: #ffffff;
					padding: 0 20rpx;
					border-radius: 16rpx;
					box-shadow: 0 0 16px -14px #333;
					margin-bottom: 30rpx;
					font-size: 28rpx;
					
					.list {
						display: flex;
						justify-content: space-between;
						align-items: center;
						padding: 20rpx 0;
						
						.rights {
							color: #909399;
							
							text:nth-child(2) {
								padding-left: 10rpx;
							}
						}
					}
					
					.border-bottom {
						border-bottom: 1px solid #F2F6FC;
					}
				}
			}
		}
	}
</style>
